<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"  xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head th:replace="_header_include::frag(~{::title},~{::style},~{})">
    <title>后台管理系统</title>
    <style>
        .el-upload-list{width: 200px;}
        .el-tag{margin-right: 10px;}
    </style>
</head>
<body>
<div id="clueManage" class="clueManage mainPadding" style="display: none;">  
    <el-breadcrumb separator="/" class="elBreadcrumb marginB20">
        <el-breadcrumb-item>Home</el-breadcrumb-item>
        <el-breadcrumb-item>财务管理</el-breadcrumb-item>
        <el-breadcrumb-item>退返款申请</el-breadcrumb-item>
    </el-breadcrumb>
    
    <el-row class="marginB20">
    		<!--<shiro:hasPermission name="financing:refundRebateManager:applyRefund">-->
		        <el-button type="primary" @click="toAllocationClue('allocationForm')">申请退款</el-button>
		    <!--</shiro:hasPermission>-->
    		<!--<shiro:hasPermission name="financing:refundRebateManager:applyRebate">-->
		        <el-button type="success" @click="toTransferClue('transferForm')">申请返款</el-button>
		    <!--</shiro:hasPermission>-->
	  </el-row>
    <div class="mainSearchBg">        
        <div class="mainSearchFormBox">
    	      <el-form :inline="true" :model="searchForm" class="demo-form-inline mainSearchForm" ref="searchForm"> 
                <el-form-item label="商务大区:"  prop="busAreaId">
                  <el-select v-model="searchForm.busAreaId" clearable  placeholder="商务大区" @change="changeBusArea" @clear="clearBusAreaList" >
                    <el-option
                      v-for="item in busAreaOptions"
                      :key="item.id"
                      :label="item.name"
                      :value="item.id">
                  </el-option>
                  </el-select>
                </el-form-item>
                <el-form-item label="签单商务组:"  prop="busGroupId">
                  <el-select v-model="searchForm.busGroupId" clearable placeholder="签单商务组"  @change="changeBusGroup" @clear="clearBusGroupList">
                    <el-option
                      v-for="item in busGroupOptions"
                      :key="item.id"
                      :label="item.name"
                      :value="item.id">
                  </el-option>
                  </el-select>
                </el-form-item>
                <el-form-item label="签单商务经理:"  prop="busSaleId">
                  <el-select v-model="searchForm.busSaleId" clearable placeholder="签单商务经理">
                    <el-option
                      v-for="item in busSaleOptions"
                      :key="item.id"
                      :label="item.name"
                      :value="item.id">
                  </el-option>
                  </el-select>
                </el-form-item>
                <el-form-item label="签约时间:">
                    <el-date-picker  v-model="searchForm.startTime" format="yyyy-MM-dd HH:mm" type="datetime" placeholder="选择日期"></el-date-picker>
                </el-form-item>
                <el-form-item label="—" class="widthauto">
                    <el-date-picker  v-model="searchForm.endTime" format="yyyy-MM-dd HH:mm" type="datetime" placeholder="选择日期"></el-date-picker>
                </el-form-item>
                <el-row v-show="isShow">
                    <el-form-item label="签约店型:"  prop="signShopType">
                      <el-select v-model="searchForm.signShopType" clearable placeholder="签约店型">
                        <el-option
                          v-for="item in signShopTypeOptions"
                          :key="item.value"
                          :label="item.name"
                          :value="item.value">
                      </el-option>
                      </el-select>
                    </el-form-item>
                    <el-form-item label="签约类型:"  prop="signType">
                      <el-select v-model="searchForm.signType" clearable  placeholder="签约类型">
                        <el-option
                          v-for="item in signTypeOptions"
                          :key="item.value"
                          :label="item.name"
                          :value="item.value">
                      </el-option>
                      </el-select>
                    </el-form-item>                
                    <el-form-item label="客户姓名:" prop="cusName">
                    <el-input v-model="searchForm.cusName" placeholder="客户姓名"></el-input>
                    </el-form-item>
                    <el-form-item label="电销事业部:"  prop="teleDeptId">
                      <el-select v-model="searchForm.teleDeptId" clearable  placeholder="电销事业部"  @change="changeTeleDept" @clear="clearTeleDeptList">
                        <el-option
                          v-for="item in teleDeptOptions"
                          :key="item.id"
                          :label="item.name"
                          :value="item.id">
                      </el-option>
                      </el-select>
                    </el-form-item>
                    <el-form-item label="电销组:"  prop="teleGorupId">
                      <el-select v-model="searchForm.teleGorupId" clearable  placeholder="电销组"  @change="changeTeleGroup" @clear="clearTeleGroupList">
                        <el-option
                          v-for="item in teleGorupOptions"
                          :key="item.id"
                          :label="item.name"
                          :value="item.id">
                      </el-option>
                      </el-select>
                    </el-form-item>
                    <el-form-item label="电销顾问:"  prop="teleSaleId">
                      <el-select v-model="searchForm.teleSaleId" clearable placeholder="电销顾问">
                        <el-option
                          v-for="item in teleSaleOptions"
                          :key="item.id"
                          :label="item.name"
                          :value="item.id">
                      </el-option>
                      </el-select>
                    </el-form-item>
                    <el-form-item label="签约省份:"  prop="signProvince">
                      <el-select v-model="searchForm.signProvince" clearable  placeholder="签约省份">
                        <el-option
                          v-for="item in provinceOptions"
                          :key="item.name"
                          :label="item.name"
                          :value="item.name">
                      </el-option>
                      </el-select>
                    </el-form-item>
                    <el-form-item label="签约单状态:"  prop="signStatus">
                      <el-select v-model="searchForm.signStatus" clearable placeholder="签约单状态">
                        <el-option
                          v-for="item in signStatusOptions"
                          :key="item.value"
                          :label="item.name"
                          :value="item.value">
                      </el-option>
                      </el-select>
                    </el-form-item>
                    <el-form-item label="客户联系方式:" prop="phone">
                        <el-input v-model="searchForm.phone" placeholder="客户联系方式"></el-input>
                    </el-form-item>
                    <el-form-item label="签约单编号:" prop="signNo">
                        <el-input v-model="searchForm.signNo" placeholder="签约单编号"></el-input>
                    </el-form-item>
                    <el-form-item label="签约项目:">
                        <el-select v-model="searchForm.signProjectId" placeholder="签约项目"  clearable filterable>
                            <el-option
                                    v-for="item in projectList"
                                    :key="item.id"
                                    :label="item.projectName"
                                    :value="item.id">
                            </el-option>
                        </el-select>
                    </el-form-item>
                </el-row>
                <div class="mainSearchBtnBox">
          		      <el-button icon="el-icon-search" type="primary" @click="searchTable()" class="searchBtn">搜索</el-button>
                    <!-- <el-button type="info" class="searchBtn">取消</el-button> -->
                    <span style="color: #5c6be8;cursor: pointer;margin:0 10px;" @click="toogleClick"><span v-if="isShow">收起</span><span v-else>展开更多</span><i :class="{'greycolor paddingL6 el-icon-arrow-up':isShow,'greycolor paddingL6 el-icon-arrow-down':!isShow}"></i></span>
                </div>
      	    </el-form>
        </div>
        <el-row>
            <el-table  ref="multipleTable" tooltip-effect="dark" border  @selection-change="handleSelectionChange"
                style="width: 100%"  :data="dataTable" >
               <el-table-column align="center" type="selection" label="全选" width="55"></el-table-column>
               <el-table-column align="center" type="index" label="序号" width="55"></el-table-column>
               <el-table-column align="center" prop="signNo" label="签约单编号"  width="170"></el-table-column>
               <el-table-column align="center" prop="projectName" label="签约项目" width="170"></el-table-column>
               <el-table-column align="center" prop="signStatus" label="签约单状态" :formatter="transformSignStatus" width="110px"></el-table-column>
               <el-table-column align="center" prop="signType" label="签约类型" :formatter="transformSignType"></el-table-column>
               <el-table-column align="center" prop="signTime" label="签约时间"></el-table-column>
               <el-table-column align="center" label="付款明细" width="100px">
               		 <template slot-scope="scope">
                            <el-button type="text" size="small" @click="recordClick(scope.row)">查看明细
                            </el-button>
                    </template>
               </el-table-column>
               <el-table-column align="center" prop="signShopType" label="签约店型" :formatter="transformSignShopType" width="100px"></el-table-column>
               <el-table-column align="center" prop="amountReceivable" label="合同应收金额"></el-table-column>
               <!--<el-table-column align="center" prop="firstToll" label="路费"></el-table-column>-->
               <!--<el-table-column align="center" prop="preferentialAmount" label="招商政策优惠金额"></el-table-column>-->
               <!--<el-table-column align="center" prop="giveAmount" label="赠送金额"></el-table-column>-->
               <el-table-column align="center" prop="cusName" label="客户姓名" ></el-table-column>
               <el-table-column align="center" prop="idCard" label="客户身份证号"></el-table-column>
               <el-table-column align="center" prop="phone" label="手机号"></el-table-column> 
               <el-table-column align="center" prop="signProvince" label="签约省份" ></el-table-column>
               <el-table-column align="center" prop="signCity" label="签约城市" ></el-table-column>
               <el-table-column align="center" prop="signDictrict" label="签约区／县" width="120"></el-table-column>
               <el-table-column align="center" prop="busAreaName" label="商务大区"></el-table-column>
               <el-table-column align="center" prop="busGroupName" label="商务小组"></el-table-column>
               <el-table-column align="center" prop="busSaleName" label="商务经理"></el-table-column>
               <el-table-column align="center" prop="teleCompanyName" label="电销分公司"></el-table-column>
               <el-table-column align="center" prop="teleDeptName" label="电销事业部"></el-table-column>
               <el-table-column align="center" prop="teleGorupName" label="电销组"></el-table-column>
               <el-table-column align="center" prop="teleSaleName" label="电销顾问"></el-table-column>
               <el-table-column align="center" prop="isRemoteSign" label="是否远程签约" :formatter="transformSex" width="120px"></el-table-column>
            </el-table>
            <table-pagination v-if="paginationShow" :pager="pager" @change="searchTable"></table-pagination>
        </el-row>
    </div>
    <!-- dialog -->
    <el-dialog  :title="refundTitle"  :visible.sync="allocationVisible" width="540px" v-dialog-drag>
        <template>
            <el-form :model="allocationForm" ref="allocationForm" :rules="allocationFormRules"> 
              <el-form-item label="退款客户金额：" :label-width="formLabelWidth" prop="cusAmount">
                  <el-input @input="allCalAmount" v-model="allocationForm.cusAmount" maxlength="10" @keyup.native="number" placeholder="" style="width:290px"></el-input>
              </el-form-item>
            <el-form-item label="承担金额：" :label-width="formLabelWidth" prop="bearAmount">
                <el-input v-model="allocationForm.bearAmount" maxlength="10" @keyup.native="number" placeholder="" style="width:290px"></el-input>
            </el-form-item>
             <el-form-item label="" v-show="isSettle==1" :label-width="formLabelWidth" class="redcolor">
                  <span style="color:red;">当前项目为给品牌商结算</span>
              </el-form-item>
              <el-form-item v-if="roleCode== 'CYCW' && businessLine == 8" label="退款审批时间：" :label-width="formLabelWidth" prop="refundTime">
                  <el-date-picker
                      style="width: 290px;"
                      v-model="allocationForm.refundTime"
                      type="datetime"
                      placeholder="选择日期时间">
                  </el-date-picker>
              </el-form-item>
                  <el-form-item v-else  label="退款时间：" :label-width="formLabelWidth" prop="refundTime">
                      <el-date-picker
                              style="width: 290px;"
                              v-model="allocationForm.refundTime"
                              type="datetime"
                              placeholder="选择日期时间">
                      </el-date-picker>
                  </el-form-item>
              <el-form-item label="上传图片：" :label-width="formLabelWidth" prop="fileList">
              		<el-upload
                    class="upload-demo"
                    :action="uploadOssHost"
                    ref="refundApplyImgUpload"
                    :on-preview="handlePreview"
                    :on-remove="handleRemove"
                    :on-success="handleSuccess"
                    :on-error="handleError"
                    :before-upload="handleBefore"
                    accept=".jpg,.png"
                    multiple
                    :data="uploadParamData"
                    :on-change="selectFile"
                    :on-exceed="handleExceed"
                    :auto-upload="false"
                    :file-list="fileList">
                    <el-button slot="trigger" size="small" type="primary">选择图片</el-button>
                     <el-button style="margin-left: 10px;" size="small" type="success" @click="submitUpload">上传</el-button>
                    <div slot="tip" class="el-upload__tip">只能上传jpg/png文件，且不超过500kb</div>
                </el-upload>
              </el-form-item>
              <el-form-item label="退款原因：" style="padding-top: 5px;" :label-width="formLabelWidth" prop="reason">
                  <el-input
                      type="textarea"
                      :rows="3"
                      placeholder=""
                      maxLength="100"
                      v-model="allocationForm.reason" 
                      style="width: 290px;">
                  </el-input>
              </el-form-item>
            </el-form>
            <div slot="footer" class="dialog-footer">
                <el-button type="primary" @click="allocationClue('allocationForm')" :disabled="btnDisabled">提 交</el-button>
                <el-button  @click="allocationClueCancel('allocationForm')">取 消</el-button>
            </div>
        </template>
    </el-dialog>
    <!-- dialog -->
    <el-dialog  :title="rebateTitle"  :visible.sync="transferVisible" width="540px" v-dialog-drag>
        <template>
            <el-form :model="transferForm" ref="transferForm" :rules="transferFormRules">
              <el-form-item label="" :label-width="formLabelWidth" prop="">
                <el-tag
                  :key="tag"
                  v-for="tag in transferForm.dynamicTags"
                  closable
                  :disable-transitions="false"
                  @close="handleClose(tag)">
                  {{tag}}
                </el-tag>
              </el-form-item>
              <el-form-item label="关联签约单：" :label-width="formLabelWidth" prop="dynamicTags">
                <el-button type="primary" @click="chooseRelevance">选择关联签约单</el-button>
              </el-form-item>
            	<el-form-item label="返款客户金额：" :label-width="formLabelWidth" prop="cusAmount">
                <el-input @input="transferCalAmount" v-model="transferForm.cusAmount" maxlength="10" @keyup.native="number" placeholder="" style="width: 290px;"></el-input>
              </el-form-item>
                <el-form-item label="承担金额：" :label-width="formLabelWidth" prop="bearAmount">
                    <el-input v-model="transferForm.bearAmount" maxlength="10" @keyup.native="number" placeholder="" style="width:290px"></el-input>
                </el-form-item>
              <el-form-item label="" v-show="isSettle==1" :label-width="formLabelWidth" class="redcolor">
                  <span style="color:red;">当前项目为给品牌商结算</span>
              </el-form-item>
              <el-form-item label="返款时间：" :label-width="formLabelWidth" prop="refundTime">
                  <el-date-picker
                      style="width: 290px;"
                      v-model="transferForm.refundTime"
                      type="datetime"
                      placeholder="选择日期时间">
                  </el-date-picker>
              </el-form-item>
              <el-form-item label="上传图片：" :label-width="formLabelWidth" prop="fileList">
                  <el-upload
                    class="upload-demo"
                    :action="uploadOssHost"
                    ref="refundApplyImgUpload"
                    :on-preview="handlePreview"
                    :on-remove="handleRemove"
                    :on-success="handleSuccess"
                    :on-error="handleError"
                    :before-upload="handleBefore"
                    accept=".jpg,.png"
                    multiple
                    :data="uploadParamData"
                    :on-change="selectFile"
                    :on-exceed="handleExceed"
                    :auto-upload="false"
                    :file-list="fileList">
                    <el-button slot="trigger" size="small" type="primary">选择图片</el-button>
                     <el-button style="margin-left: 10px;" size="small" type="success" @click="submitUpload">上传</el-button>
                    <div slot="tip" class="el-upload__tip">只能上传jpg/png文件，且不超过500kb</div>
                </el-upload>
              </el-form-item>
              <el-form-item label="返款原因：" style="padding-top: 5px;" :label-width="formLabelWidth" prop="reason">
                  <el-input
                      type="textarea"
                      :rows="3"
                      placeholder=""
                      maxLength="100"
                      v-model="transferForm.reason" 
                      style="width: 290px;">
                  </el-input>
              </el-form-item>
            </el-form>
            <div slot="footer" class="dialog-footer">
                <el-button type="primary" @click="transferClue('transferForm')" :disabled="btnDisabled1">提 交</el-button>
                <el-button  @click="transferClueCancel('transferForm')">取 消</el-button>
            </div>
        </template>
    </el-dialog>
    <!-- dialog -->
    <!-- 付款明细 -->
    <el-dialog :title="payTitle" :visible.sync="recordDialog" width="1000px" v-dialog-drag>
        <el-table
            ref="recordTable" 
            tooltip-effect="dark"
            style="width: 100%;margin-bottom: 20px;"
            border
            :data="recordTable" 
            >
            <el-table-column align="center" prop="" label="序号" type="index" name="type" width="55"></el-table-column>
            <el-table-column align="center" prop="payName" label="付款人姓名" width="200"></el-table-column>
            <el-table-column align="center" prop="payType" label="付款类型" :formatter="transformPayType"></el-table-column>
            <el-table-column align="center" prop="statementNo" label="结算单编号" width="200"></el-table-column>
            <el-table-column align="center" prop="payMode" label="付款方式" :formatter="getPayModeText"></el-table-column>
            <el-table-column align="center" prop="payTime" label="付款时间" :formatter="getTimeText"></el-table-column>
            <el-table-column align="center" prop="amountReceived" label="实收金额"></el-table-column>
            <el-table-column align="center" prop="amountEquipment" label="实收设备金额"></el-table-column>
            <el-table-column align="center" prop="preferentialAmount" label="招商政策优惠金额" width="150"></el-table-column>
            <el-table-column align="center" prop="firstToll" label="路费" width="150"></el-table-column>
            <el-table-column align="center" prop="giveAmount" label="赠送金额" width="150"></el-table-column>
            <el-table-column align="center" prop="giveType" label="赠送类型" width="150" :formatter="transGiveType"></el-table-column>

            <el-table-column align="center" prop="amountPerformance" label="业绩金额"></el-table-column>
            <el-table-column align="center" prop="accountStatus" label="结算状态" :formatter="transformStatus"></el-table-column>
            <el-table-column align="center" prop="money" label="结算金额"></el-table-column>
            <el-table-column align="center" prop="commissionMoney" label="佣金"></el-table-column>
            <el-table-column align="center" prop="busGroupName" label="商务组"></el-table-column>
            <el-table-column align="center" prop="busSaleName" label="商务经理"></el-table-column>
            <el-table-column align="center" prop="remarks" label="备注"></el-table-column>
        </el-table>
    </el-dialog>
    <!-- 关联签约单 -->
    <!-- dialog -->
    <el-dialog title="选择关联签约单" :visible.sync="dialogFormChooseVisible" width="1000px" v-dialog-drag>      
      <el-row class="marginB10 greybg padding20" style="padding-bottom: 0;">
        <el-form :inline="true" :model="dialogFormChoose" ref="dialogFormChoose">
          <el-form-item class="formItem" label="签约时间：">
              <el-date-picker  v-model="dialogFormChoose.startTime" format="yyyy-MM-dd HH:mm" type="datetime" placeholder="选择日期"></el-date-picker>
          </el-form-item>
          <el-form-item class="formItem" label="—">
              <el-date-picker  v-model="dialogFormChoose.endTime" format="yyyy-MM-dd HH:mm" type="datetime" placeholder="选择日期"></el-date-picker>
          </el-form-item>
          <el-form-item label=""  prop="">
            <el-input v-model="dialogFormChoose.signNo" placeholder="签约单编号"></el-input>
          </el-form-item>
          <el-form-item label=""  prop="">
            <el-input v-model="dialogFormChoose.cusName" placeholder="客户姓名"></el-input>
          </el-form-item>
          <el-form-item label=""  prop="">
            <el-button type="primary" size="medium" @click="chooseRelevance()" icon="el-icon-search">搜索</el-button>
          </el-form-item>
        </el-form>  
      </el-row>
      <el-table 
          tooltip-effect="dark"
          style="width: 100%"
          ref="chooseSignTable"
          border
          :row-key="getRowKey"
          :data="dataTableChoose" 
           @selection-change="signSelectionChange"
          class="marginB10">
          <el-table-column align="center" :reserve-selection="true"  prop="" type="selection" name="type" width="55"></el-table-column>
          <el-table-column align="center" prop="" label="序号" type="index" name="type" width="55"></el-table-column>
          <el-table-column align="center" prop="signNo" label="签约单编号"></el-table-column>
          <el-table-column align="center" prop="signTime" label="签约时间"></el-table-column>
          <el-table-column align="center" prop="cusName" label="客户姓名"></el-table-column>
          <el-table-column align="center" prop="phone" label="客户手机号" width="150"></el-table-column>
          <el-table-column align="center" prop="amountReceivable" label="合同应收金额" width="120"></el-table-column>
      </el-table>
      <div slot="footer" class="dialog-footer">
          <el-button type="primary" @click="submitSign('dialogFormChoose')">提交</el-button>
          <el-button @click="dialogFormChooseVisibleCancel">取消</el-button>
      </div>
    </el-dialog>
</div>
<!-- import common js-->
<div th:include="_footer_include :: #jsLib"></div>

</body>
<script type="text/javascript"
        th:src="@{'/js/custom/file_upload/lib/crypto1/crypto/crypto.js'}"></script>
<script type="text/javascript"
        th:src="@{'/js/custom/file_upload/lib/crypto1/hmac/hmac.js'}"></script>
<script type="text/javascript"
        th:src="@{'/js/custom/file_upload/lib/crypto1/sha1/sha1.js'}"></script>
<script type="text/javascript"
        th:src="@{'/js/custom/file_upload/lib/base64.js'}"></script>
<script type="text/javascript"
        th:src="@{'/js/custom/file_upload/plupload.full.min.js'}"></script>
<script type="text/javascript"
        th:src="@{'/js/custom/financing/file_upload.js'}"></script>
<script th:inline="javascript">
var busAreaList=[[${busAreaList}]];//商务大区
var teleDeptList=[[${teleDeptList}]];//电销事业部
var provinceList=[[${provinceList}]];//省份
var vistitStoreTypeList=[[${vistitStoreTypeList}]];//签约店型
var ossSignatureUrl = [[${ossUrl}]];//上传文件地址
var payModeItem =[[${payModeItem}]];
var giveTypeList =[[${giveTypeList}]];
var businessLine = [[${businessLine}]];
var roleCode = [[${roleCode}]];
var clueVM = new Vue({
        el: '#clueManage',
        data: {
            businessLine:businessLine,
            roleCode:roleCode,
          paginationShow: false,
          isShow:false,
          btnDisabled:false,
          btnDisabled1:false,
            projectList: [],
      		searchForm: {
	       		busAreaId: '',
	       		busGroupId: '',
	       		busSaleId: '',
	       		signType: '',
	       		signShopType: '',
	       		startTime: '',
	       		endTime: '',
	       		cusName: '',
	       		teleDeptId: '',
	       		teleGorupId: '',
	       		teleSaleId: '',
	       		signProvince: '',
	       		signStatus: '',
	       		phone: '',
	       		signNo: '',
                signProjectId: ''
          },
          allocationForm: {
        	  
        	signId:'',
          	reason:'',
            refundTime:'',
            cusAmount:'',
              bearAmount:'',
            fileList: [],
          },
          transferForm: {
        	  signId:'',
          	  dynamicTags: [],
              reason:'',
              refundTime:'',
              cusAmount:'',
              bearAmount:'',
              signProjectId:'',
              signProvince:'',
              fileList: [],
          },
          dataTable:[],
          recordDialog:false,
          recordTable:[],
          busAreaOptions:busAreaList,
          busGroupOptions:[],
          busSaleOptions:[],
          teleDeptOptions:teleDeptList,
          teleGorupOptions:[],
          teleSaleOptions:[],
          provinceOptions:provinceList,
          signShopTypeOptions:vistitStoreTypeList,
          signTypeOptions:[{
          	value:1,
          	name:"一次性全款"
          },{
          	value:2,
          	name:"先交定金"
          }],
          signStatusOptions:[{
          	value:1,
          	name:"正常"
          },{
          	value:2,
          	name:"退款确认中"
          },{
          	value:3,
          	name:"返款确认中"
          },{
          	value:4,
          	name:"确认退款"
          },{
          	value:5,
          	name:"确认返款"
          },{
          	value:6,
          	name:"已退款"
          },{
          	value:7,
          	name:"已返款"
          }],
          allocationVisible: false,
          transferVisible: false,
          isSettle:0,
          refundTitle:'',
          rebateTitle:'',
          payTitle:'',
          pager:{
              total: 0,
              currentPage: 1,
              pageSize: 20,
          },
          allocationFormRules: {
          	reason : [
                { required: true, message: '请输入退款原因', trigger: 'blur' }
            ],
            refundTime : [
                { required: true, message: '请选择退款时间', trigger: 'blur' }
            ],
            cusAmount: [
                { required: true, message: '请输入退款客户金额', trigger: 'blur' },
                { validator:function(rule,value,callback){
                    var reg =  /^[0-9]+[0-9]*]*$/ ;
                   if(value !=null && value !="null" && value !="" && !reg.test(value) ){
                        callback(new Error("请输入正整数"));
                        return;
                    }else{
                        callback();
                    }

                }, trigger: 'blur'}
            ],
             bearAmount: [
                  { required: true, message: '请输入承担金额', trigger: 'blur' },
                  { validator:function(rule,value,callback){
                          var reg =  /^[+-]?(0|([1-9]\d*))(\.\d+)?$/g;
                          if(value !=null && value !="null" && value !="" && !reg.test(value) ){
                              callback(new Error("请输入数字"));
                              return;
                          }else{
                              callback();
                          }

                      }, trigger: 'blur'}
              ],
            fileList: [
                { required: true, message: '请上传图片', trigger: 'change' }
            ],
          },
          transferFormRules: {
        	reason : [
                { required: true, message: '请输入返款原因', trigger: 'blur' }
            ],
            dynamicTags : [
                { required: true, message: '请选择关联签约单', trigger: 'blur' }
            ],
            refundTime : [
                { required: true, message: '请选择退款时间', trigger: 'blur' }
            ],
            cusAmount: [
                { required: true, message: '请输入返款客户金额', trigger: 'blur' },
                { validator:function(rule,value,callback){
                    var reg =  /^[0-9]+[0-9]*]*$/ ;
                   if(value !=null && value !="null" && value !="" && !reg.test(value) ){
                        callback(new Error("请输入正整数"));
                        return;
                    }else{
                        callback();
                    }

                }, trigger: 'blur'}
            ],
              bearAmount: [
                  { required: true, message: '请输入承担金额', trigger: 'blur' },
                  { validator:function(rule,value,callback){
                          var reg =  /^[+-]?(0|([1-9]\d*))(\.\d+)?$/g;
                          if(value !=null && value !="null" && value !="" && !reg.test(value) ){
                              callback(new Error("请输入数字"));
                              return;
                          }else{
                              callback();
                          }

                      }, trigger: 'blur'}
              ],
            fileList: [
                { required: true, message: '请上传图片', trigger: 'change' }
            ],
          },
          multipleSelection:[],
          signSelection:[],
          formLabelWidth: '150px',
          formLabelWidth1: '120px',     
          dialogFormChooseVisible:false, //关联弹窗
          dialogFormChoose:{
        	  startTime:'',
        	  endTime:'',
        	  cusName:'',
        	  signNo:'',
        	  signProjectId:'',
        	  signProvince:''
        	  
          },   
          dataTableChoose:[],   
          uploadOssHost:'',
          uploadParamData: {
              key:'22',
              policy:'',
              OSSAccessKeyId:'',
              success_action_status : '200', //让服务端返回200,不然，默认会返回204
              signature:'', 
              'x:params':'',
              'realName':''
          },
          fileList:[],
          limit:1,
          ossUrl:ossSignatureUrl,
          storeForm: {
            busAreaId: '',
            busGroupId: '',
            busSaleId: '',
            signType: '',
            signShopType: '',
            startTime: '',
            endTime: '',
            cusName: '',
            teleDeptId: '',
            teleGorupId: '',
            teleSaleId: '',
            signProvince: '',
            signStatus: '',
            phone: '',
            signNo: ''
          },
          storeId: '',
          scrollTop: 0,
        },
        methods: {
            //计算退款的承担金额
            allCalAmount(){
                var rows = this.multipleSelection;
                var aone = parseFloat(rows[0].ratio/100);
                var atwo = parseFloat(this.allocationForm.cusAmount);
                if (isNaN(aone)) aone = 0
                if (isNaN(atwo)) atwo = 0
                this.allocationForm.bearAmount = (aone * atwo) + "";
            },
            //计算返款的承担金额
            transferCalAmount(){
                var rows = this.multipleSelection;
                var aone = parseFloat(rows[0].ratio/100);
                var atwo = parseFloat(this.transferForm.cusAmount);
                if (isNaN(aone)) aone = 0
                if (isNaN(atwo)) atwo = 0
                this.transferForm.bearAmount = (aone * atwo) + "";
            },
        	getUploadParam(){
                var signUrl = this.ossUrl+"?serviceType=aggregation";
                var param={};
                
                 axios.get(signUrl, param)
                .then(function (response) {
                   // console.info(response);
                    var respData= response.data;
                    var host = respData.host;
                    var params={};
                    var new_multipart_params = {
                            dir:respData.dir,
                            'policy': respData.policy,
                            'OSSAccessKeyId': respData.accessid,
                            'success_action_status' : '200', //让服务端返回200,不然，默认会返回204
                            'signature': respData.signature,
                            'x:params':params,//自定义编码，basse64编码后的字符串,
                            'realName':''
                   };
                  clueVM.uploadParamData= new_multipart_params;
                  clueVM.uploadOssHost = host;
                })
                .catch(function (error) {
                     console.log(error);
                });
            },
            selectFile(file, fileList){
            	var fileLength = fileList.length;
	          	  if(fileLength>=2){
	          		  //验证最后2个文件是否都是即将要上传的，如果是，只保留一个
	          		  var lastSecondFile = fileList[fileLength-2];
	          		  if(!lastSecondFile.hasOwnProperty("id")){
	          			  fileList.splice(length-2,1);
	          		  }
	          		  
	          	  }
                clueVM.uploadParamData.key= clueVM.uploadParamData.dir+clueVM.random_string(10)+clueVM.get_suffix(file.name),
                clueVM.uploadParamData.realName= file.name
           },
         submitUpload(){
             //this.customUpload();
             this.$refs.refundApplyImgUpload.submit();
         },
         handlePreview(file){
             
         },
         handleRemove(file,fileList){
        	 var id = file.id;
        	 if(!id){
        		 return;
        	 }
        	 clueVM.transferForm.fileList.splice(clueVM.contains(clueVM.transferForm.fileList,id),1);
        	 clueVM.allocationForm.fileList.splice(clueVM.contains(clueVM.allocationForm.fileList,id),1);
             var param = {};
             var idList = new Array();
             idList.push(id)
             param.idList = idList;
             axios.post('/financing/refund/deleteImgByIdList',param)
             .then(function (response) {
                   var result =  response.data;
                   if(result.code=='0'){
                	   clueVM.deleteFile(id);
                       clueVM.$message({message:'删除成功',type:'success'});
                   }else{
                       console.error(response);
                       clueVM.$message({message:result.msg,type:'error'});
                   }
                   
             })
             .catch(function (error) {
                  console.log(error);
             });
         },
         deleteFile(id){//把imgList中的文件移除
         	var curImgList = this.fileList;
         	for(var i=0;i<curImgList.length;i++){
         		var curImg = curImgList[i];
         		if(curImg.id==id){
         			curImgList.splice(i--,1);
         			break;
         		}
         	}
         	
         },
         contains(a, obj) {
        	 var i = a.length;
        	 while (i--) {
        	  if (a[i] === obj) {
        	   return i;
        	  }
        	 }
        	 return false;
        	},
         handleExceed(files, fileList) {
             //this.$message.warning(`当前限制选择 3 个文件，本次选择了 ${files.length} 个文件，共选择了 ${files.length + fileList.length} 个文件`);
           },
           handleSuccess(response, file, fileList){
        	   console.info(fileList);
               console.info(clueVM.fileList);
               var realName = file.name;
               var randomName = clueVM.uploadParamData.key;
               var imgUrl =  clueVM.uploadOssHost+"/"+randomName;
               var param = {};
               param.realName=realName;
               param.imgUrl = imgUrl;
               var randomNameArr = randomName.split("/");
               param.randomName = randomNameArr[randomNameArr.length-1];
               axios.post('/financing/refund/insertImgInfo', param)
               .then(function (response) {
                   var resData = response.data;
                   if(resData.code=='0'){
                       var lastFile = {};
                       lastFile.id= resData.data;
                       lastFile.name=realName;
                       lastFile.url = imgUrl;
                       lastFile.randomName = randomName; 
                       var curList = clueVM.fileList;
                       clueVM.transferForm.fileList.push(resData.data);
                       clueVM.allocationForm.fileList.push(resData.data);
                       curList.push(lastFile);
                       clueVM.$refs['allocationForm'].validateField(["fileList"]);
                       clueVM.$refs['transferForm'].validateField(["fileList"]);
                       clueVM.$message({message:'上传成功',type:'success'});
                   }else{
                       clueVM.$message({message:'上传失败',type:'error'});
                   }
                   
               })
               .catch(function (error) {
                    console.log(error);
               });
               
               
           },
           handleError(err, file, fileList){
               console.info(err);
           },
           handleBefore(file){
           },
           random_string(len) {
               len = len || 32;
               var chars = 'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678';
               var maxPos = chars.length;
               var pwd = '';
               for (i = 0; i < len; i++) {
                   pwd += chars.charAt(Math.floor(Math.random() * maxPos));
               }
               return pwd;
           },
           get_suffix(filename) {
               var pos = filename.lastIndexOf('.')
               suffix = ''
               if (pos != -1) {
                   suffix = filename.substring(pos);
               }
               return suffix;
           },
          handleClose(tag) {
            this.transferForm.dynamicTags.splice(this.transferForm.dynamicTags.indexOf(tag), 1);
          },
          chooseRelevance(){
        	  var param ={};
              var startTime = this.dialogFormChoose.startTime;
              var endTime = this.dialogFormChoose.endTime;
              if(startTime&&endTime&&startTime> endTime){
              	this.$message({
                      message: '开始时间不能大于结束时间',
                      type: 'warning'
                    });
                  return;
              }
              param.startTime = startTime;
              param.endTime = endTime;
              param.cusName = this.dialogFormChoose.cusName;
              param.signProvince = this.dialogFormChoose.signProvince;
              param.signProjectId = this.dialogFormChoose.signProjectId;
              param.signNo = this.dialogFormChoose.signNo;
              param.signId = this.dialogFormChoose.signId;
              
              console.info(param);
              axios.post('/financing/refundRebate/rebatesignList', param)
              .then(function (response) {
                    var result =  response.data;
                    clueVM.dataTableChoose= result.data;
              })
              .catch(function (error) {
                   console.log(error);
              });
            this.dialogFormChooseVisible=true;
          },
        	searchTable() {
                var param ={};
                var startTime = this.searchForm.startTime;
                var endTime = this.searchForm.endTime;
            	var vilad=false;
                if(startTime&&endTime&&startTime> endTime){
                	vilad=true;
                }
                if(vilad){
                	this.$message({
                        message: '开始时间不能大于结束时间',
                        type: 'warning'
                      });
                    return;
                }
                param.startTime = startTime;
                param.endTime = endTime;
                param.pageSize = this.pager.pageSize;
                param.pageNum = this.pager.currentPage;
                param.busAreaId = this.searchForm.busAreaId;
                param.busGroupId = this.searchForm.busGroupId;
                param.busSaleId = this.searchForm.busSaleId;
                param.signType = this.searchForm.signType;
                param.signShopType = this.searchForm.signShopType;
                param.cusName = this.searchForm.cusName;
                param.teleDeptId = this.searchForm.teleDeptId;
                param.teleGorupId = this.searchForm.teleGorupId;
                param.teleSaleId = this.searchForm.teleSaleId;
                param.signProvince = this.searchForm.signProvince;
                param.signStatus = this.searchForm.signStatus;
                param.phone = this.searchForm.phone;
                param.signNo = this.searchForm.signNo;
                param.signProjectId = this.searchForm.signProjectId;
                //列表只查询正常数据，取消删除数据不查询
                //param.delFalg = this.searchForm.delFalg;
                console.info(param);
                axios.post('/financing/refundRebate/list', param)
                .then(function (response) {
                    var result =  response.data;
                    console.info(result);
                    var table=result.data;
                    clueVM.dataTable= table.data;
                    clueVM.pager.total =  table.total;
                    clueVM.pager.currentPage = table.currentPage;

                    // 取出存储的id
                    if(!clueVM.paginationShow){
                       if(clueVM.storeId){
                           clueVM.$nextTick(function(){
                              var storage = [];
                              clueVM.dataTable.forEach(function(item, index){
                                  if(item.signId === clueVM.storeId ){
                                      storage.push(clueVM.dataTable[index]);
                                  }
                              })
                              clueVM.toggleSelection(storage);
                              clueVM.$el.querySelector('.el-table__body-wrapper').scrollTop = clueVM.scrollTop;
                          })
                      }
                    }else{
                      removeSessionStore ("refundRebateManagerStoreForm");
                      removeSessionStore ("refundRebateManagerOtherVal");
                    }
                    clueVM.paginationShow = true;
                    clueVM.storeForm = clueVM.searchForm;

                })
                .catch(function (error) {
                     console.log(error);
                });
                
            },
            toggleSelection(rows) { // table select 默认选中fn
                if (rows) {
                    rows.forEach(row => {
                        this.$refs.multipleTable.toggleRowSelection(row,true);
                    });
                } else {
                    this.$refs.multipleTable.clearSelection();
                }
            },
              //选择行
              handleSelectionChange(val) {
                  this.multipleSelection = val;
              },
              signSelectionChange(val) {
                  this.signSelection = val;
              },
              handleSizeChange(val) {
                  //下拉框  每页 10,20条切换 调用
                     console.log(`每页 ${val} 条`);
                  this.pageSize = val;
                  this.initTableData(1);
               },
               handleCurrentChange(val) {
                   //点击 页码
                 console.log(`当前页: ${val}`);
                 this.initTableData(val);
               },
               //是否转换方法
               transformSex(row, column, cellValue, index) {
                 var text="";
                 if(cellValue=="1"){
                   text="是"
                 }else if(cellValue=="0"){
                   text="否"
                 }
                 return text;
               },
               //签约类型转换方法
               transformSignType(row, column, cellValue, index) {
                 var text="";
                 if(cellValue=="1"){
                   text="一次性全款"
                 }else if(cellValue=="2"){
                   text="先交定金"
                 }
                 return text;
               },
               //邀约状态转换方法
               transformSignStatus(row, column, cellValue, index) {
                 var text="";
                 if(cellValue=="2"){
                   text="退款确认中";
                 }else if(cellValue=="3"){
                   text="返款确认中";
                 }else if(cellValue=="4"){
                   text="确认退款";
                 }else if(cellValue=="5"){
                   text="确认返款";
                 }else if(cellValue=="6"){
                   text="已退款";
                 }else if(cellValue=="7"){
                   text="已返款";
                 }else{
                   text="正常";
                 }
                 return text;
               },
               //合伙人转换方法
               transformSignShopType(row, column, cellValue, index) {
             	  var text="";
             	  if(vistitStoreTypeList){
 	                  for(var i=0;i<vistitStoreTypeList.length;i++){
 	                		if(cellValue==vistitStoreTypeList[i].value){
 	                			text=vistitStoreTypeList[i].name;
 	                		}
 	                	}
             	  }
                   return text;
               },
              
               //关联签约单确定
               submitSign() {
           	       var rows = this.signSelection;
            	   if(rows.length==0){
                       this.$message({
                          message: '请至少选择一条数据进行关联',
                          type: 'warning'
                        });
                       return;
                   }
            	   var signList=[];
            	   for(var i=0;i<rows.length;i++){
               			signList.push(rows[i].signNo);
                   }
            	   this.transferForm.dynamicTags =signList;
            	   this.dialogFormChooseVisible=false;
            	   this.$refs['transferForm'].validateField(["dynamicTags"]);
               },
               //关联签约单取消
               dialogFormChooseVisibleCancel() {
            	   this.dialogFormChooseVisible = false;
            	   this.$refs.chooseSignTable.clearSelection();
               },
               changeTeleDept(selectedValue){//电销事业部
                   this.clearTeleDeptList();
                   if(!selectedValue){
                       return;
                   }
                   var param ={};
                   param.id = selectedValue;
                   axios.post('/organization/organization/queryTeleGroupListByParentId', param)
                   .then(function (response) {
                         var result =  response.data;
                         var table=result.data;
                         clueVM.teleGorupOptions= table;
                   })
                   .catch(function (error) {
                        console.log(error);
                   });
               },
               changeTeleGroup(selectedValue){//改变电销组
                   this.clearTeleGroupList();
                   if(!selectedValue){
                       return;
                   }
                   var param ={};
                   param.id = selectedValue;
                   axios.post('/organization/organization/queryTeleSaleByOrgId', param)
                   .then(function (response) {
                         var result =  response.data;
                         var table=result.data;
                         clueVM.teleSaleOptions= table;
                   })
                   .catch(function (error) {
                        console.log(error);
                   });
               },
               clearTeleDeptList(){
                   this.teleGorupOptions=[];
                   this.searchForm.teleGorupId='';
                   this.clearTeleGroupList();
                   
               },
               clearTeleGroupList(){
                    this.teleSaleOptions=[];
                    this.searchForm.teleSaleId='';
               },
               changeBusArea(selectedValue){//改变商务大区
                   this.clearBusAreaList();
                   if(!selectedValue){
                       return;
                   }
                   var param ={};
                   param.id = selectedValue;
                   axios.post('/organization/organization/queryBusGroupListByParentId', param)
                   .then(function (response) {
                         var result =  response.data;
                         var table=result.data;
                         clueVM.busGroupOptions= table;
                   })
                   .catch(function (error) {
                        console.log(error);
                   });
               },
               changeBusGroup(selectedValue){//改变商务组
                   this.clearBusGroupList();
                   if(!selectedValue){
                       return;
                   }
                   var param ={};
                   param.id = selectedValue;
                   axios.post('/organization/organization/queryBusManagerByOrgId', param)
                   .then(function (response) {
                         var result =  response.data;
                         var table=result.data;
                         clueVM.busSaleOptions= table;
                   })
                   .catch(function (error) {
                        console.log(error);
                   });
               },
               clearBusAreaList(){
                   this.busGroupOptions=[];
                   this.searchForm.busGroupId='';
                   this.clearBusGroupList();
                   
               },
               clearBusGroupList(){
                    this.busSaleOptions=[];
                    this.searchForm.busSaleId='';
               },
               //打开申请退款
               toAllocationClue(formName) {
            	   if(this.$refs[formName]){
	            	   this.$refs[formName].resetFields();
            	   }
           	       this.fileList=[];
           	       var rows = this.multipleSelection;
            	   if(rows.length!=1){
                       this.$message({
                          message: '一次只允许申请一个签约单的退款操作',
                          type: 'warning'
                        });
                       return;
                   }
                   if(rows[0].isNotAllSubmit !=null && rows[0].isNotAllSubmit ==1){
                       this.$message({
                           message: '此签约单还有未提交对账的付款记录，请先提交对账，再申请退款！',
                           type: 'warning'
                       });
                       return;
                   }
            	 /*   if(rows[0].signStatus!=1){
            		   this.$message({
                           message: '只允许操作签约状态为正常的数据',
                           type: 'warning'
                         });
                        return;
            	   } */
            	   this.allocationForm.signId=rows[0].signId;
            	   this.allocationForm.refundTime=new Date();
            	   this.isSettle=rows[0].isSettle;
            	   this.refundTitle="（"+rows[0].signNo+"）签约单申请退款";
                   this.allocationVisible = true;
                   this.btnDisabled=false;
               },
              allocationClueCancel(formName){//申请退款取消
            	   this.$refs[formName].resetFields();
            	   this.allocationVisible = false;
              },
              allocationClue(formName){//申请退款
                var rows = this.multipleSelection;
                debugger
                this.$refs[formName].validate((valid) => {
                  if (valid) {
                    var param  = {};
                    param.signId=this.allocationForm.signId;
                    param.reason=this.allocationForm.reason;
                    param.refundTime=this.allocationForm.refundTime;
                    param.cusAmount=this.allocationForm.cusAmount;
                    param.bearAmount = this.allocationForm.bearAmount;
                    param.imgList=this.fileList;
                    this.btnDisabled=true;
                        axios.post('/financing/refundRebate/applyRefund',param)
                            .then(function (response) {
                                var data =  response.data;
                                if(data.code=='0'){
                                  clueVM.$message({message:'申请成功',type:'success',duration:1000,onClose:function(){
                                    // clueVM.allocationVisible = false;
                                    // clueVM.searchTable();
                                    window.location.href='/financing/refundRebate/initRefundRebateManager';
                                  }});
                                }else{
                                  clueVM.$message({
                                        message: "接口调用失败",
                                        type: 'error'
                                      }); 
                                      clueVM.btnDisabled=false;
                                }
                            })
                            .catch(function (error) {
                              clueVM.btnDisabled=false;
                              console.log(error);
                            });
            	            //end
            	          } else {
            	            console.log('error submit!!');
            	            return false;
            	          }
            	    });
                  // 存储选中信息--start
                  var clueId=rows[0].signId;  
                  setSessionStore("refundRebateManagerStoreForm", this.storeForm);
                  var otherVal = {
                      "currentPage": this.pager.currentPage,
                      "clueId": clueId,
                      "scrollTop": this.$el.querySelector('.el-table__body-wrapper').scrollTop
                  }
                  setSessionStore("refundRebateManagerOtherVal", otherVal);
                  // 存储选中信息--end 
              },// method end
              //打开返款申请
              toTransferClue(formName) {
                   if(this.$refs[formName]){
  	            	   this.$refs[formName].resetFields();
              	   }
                   this.fileList=[];
                   this.transferForm.dynamicTags =[];
           	       var rows = this.multipleSelection;
            	   if(rows.length!=1){
                       this.$message({
                          message: '请选择一条数据进行返款申请',
                          type: 'warning'
                        });
                       return;
                   }
            	   /* if(rows[0].signStatus!=1){
            		   this.$message({
                           message: '只允许操作签约状态为正常的数据',
                           type: 'warning'
                         });
                        return;
            	   } */
                   this.transferForm.signId = rows[0].signId;
                   this.transferForm.refundTime=new Date();
                   this.dialogFormChoose.signProjectId = rows[0].signProject;
                   this.dialogFormChoose.signProvince = rows[0].signProvince;
                   this.dialogFormChoose.signId = rows[0].signId;
                   this.isSettle=rows[0].isSettle;
                   this.rebateTitle="（"+rows[0].signNo+"）签约单申请返款";
                   this.transferVisible = true;
                   this.btnDisabled1=false;
               },
               transferClueCancel(formName){//外调经理取消
            	   this.$refs[formName].resetFields();
            	   this.transferVisible = false;
            	   this.dialogFormChooseVisibleCancel();
               },
               transferClue(formName){//外调经理
                  var rows = this.multipleSelection;
            	    this.$refs[formName].validate((valid) => {
                      if (valid) {
                            //外调
                            var param  = {};
                            param.signId=this.transferForm.signId;
                        param.reason=this.transferForm.reason;
                        param.refundTime=this.transferForm.refundTime;
                        param.cusAmount=this.transferForm.cusAmount;
                        param.bearAmount = this.transferForm.bearAmount;
                        param.signNoList=this.transferForm.dynamicTags;
                        param.imgList=this.fileList;
                        this.btnDisabled1=true;
                          axios.post('/financing/refundRebate/applyRebate',param)
                              .then(function (response) {
                                  var data =  response.data;
                                  if(data.code=='0'){
                                  clueVM.$message({message:'申请成功',type:'success',duration:1000,onClose:function(){
                                    window.location.href='/financing/refundRebate/initRefundRebateManager';
                                    // clueVM.transferVisible = false;
                                    // clueVM.searchTable();
                                  }});
                                  }else{
                                  clueVM.$message({
                                          message: "接口调用失败",
                                          type: 'error'
                                        }); 
                                        clueVM.btnDisabled1=false;
                                  }
                              })
                              .catch(function (error) {
                                console.log(error);
                                clueVM.btnDisabled1=false;
                              });
                        //end
            	          } else {
            	            console.log('error submit!!');
                          // clueVM.btnDisabled1=false;
            	            return false;
            	          }

                    // 存储选中信息--start
                    var clueId=rows[0].signId; 
                    setSessionStore("refundRebateManagerStoreForm", this.storeForm);
                    var otherVal = {
                        "currentPage": this.pager.currentPage,
                        "clueId": clueId,
                        "scrollTop": this.$el.querySelector('.el-table__body-wrapper').scrollTop
                    }
                    setSessionStore("refundRebateManagerOtherVal", otherVal);
                    // 存储选中信息--end  
            	  });
            	   
                 },// method end
                 recordClick(row) {//查看明细
                     // row.signNo;
                     var param = {};
                     this.payTitle="（"+row.signNo+"）付款明细";
                     param.idList = [row.signId];
                     axios.post('/sign/signRecord/listPayDetail', param)
                     .then(function (response) {
                         var resData = response.data;
                         console.log(resData.data)
                         if(resData.code=='0'){
                         	clueVM.recordTable= resData.data;
                         }else{
                             clueVM.$message({message:resData.msg,type:'error'});
                             console.error(resData);
                         }
                         clueVM.recordDialog=true;
                     })
                     .catch(function (error) {
                          console.log(error);
                     }).then(function(){
                     });
                    
                 },
                 number(){//添加签约单余款
            　　　      			this.allocationForm.cusAmount=this.allocationForm.cusAmount.replace(/[^\.\d]/g,'');
                        this.allocationForm.cusAmount=this.allocationForm.cusAmount.replace('.','');
            　　　      			this.transferForm.cusAmount=this.transferForm.cusAmount.replace(/[^\.\d]/g,'');
                        this.transferForm.cusAmount=this.transferForm.cusAmount.replace('.','');
                　　			},
                 getTimeText(row, column, value, index){
                     var valText="";
                     if(value){
                         valText =  moment(value).format("YYYY-MM-DD");
                     }
                     return valText;
                 },
                 getSignShopTypeText(row, column, value, index){
                 	var valText="";
                     if (value == 1) {
                         valText = "旗舰店";
                     } else if (value == 2) {
                         valText = "创业店";
                     } else if (value == 3) {
                         valText = "标准店";
                     } else if (value == 5) {
                         valText = "区域代理";
                     } else if (value == 6) {
                         valText = "单技术";
                     }
                     return valText;
                 },

                transGiveType(row, column, value, index) {
                  var text="";
                  for(var i=0;i<giveTypeList.length;i++) {
                    if(giveTypeList[i].value ==value){
                      text = giveTypeList[i].name;
                    }
                  }
                  return text;
                },

                 getPayModeText(row, column, value, index){
                   var valText="";
                   if(!value){
                     return valText;
                   }
                   var vals = value.split(",");
                   if(payModeItem){
                     for(var j = 0 ; j < vals.length;j++  ){
                       for(var i = 0; i < payModeItem.length ; i++){
                         if(payModeItem[i].value == vals[j]){
                           if(j==0){
                             valText += payModeItem[i].name;
                           }else{
                             valText += ","+payModeItem[i].name;
                           }

                         }
                       }
                     }
                   }
                   return valText;
                 },
                 getStatusText(row, column, value, index){
                 	   var valText="";
                 	   if(value==0){
                 		   valText="驳回";
                 	   }
                 	   else if(value==1){
                            valText="审核中";
                        }else if(value==2){
                            valText="有效";
                        }
                        return valText;
                 },
               //付款类型转换方法
                 transformPayType(row, column, cellValue, index) {
                   var text="";
                   if(cellValue=="1"){
                     text="全款"
                   }else if(cellValue=="2"){
                     text="定金"
                   }else if(cellValue=="3"){
                     text="追加定金"
                   }else if(cellValue=="4"){
                     text="尾款"
                   }
                   return text;
                 },
               //处理状态转换方法
                 transformStatus(row, column, cellValue, index) {
                   var text="";
                   if(cellValue=="0"){
                     text="待处理";
                   }else if(cellValue=="1"){
                     text="驳回";
                   }else if(cellValue=="2"){
                     text="提交对账";
                   }else if(cellValue=="3"){
                     text="已对账";
                   }else if(cellValue=="4"){
                     text="已结算";
                   }
                   return text;
                 },
                 getRowKey(row) {
                   return row.signNo;
                 },
                toogleClick(){
                    if(this.isShow){
                        this.isShow=false
                    }else{
                        this.isShow=true
                    }          
                },
            //获取签约项目
            getProjectList() {
                axios.post('/sign/signRecord/queryProjectList', {})
                    .then(function (response) {
                        var result = response.data;
                        if (result.code == '0') {
                            var table = result.data;
                            clueVM.projectList = table;
                        } else {
                            console.error(response);
                        }

                    })
                    .catch(function (error) {
                        console.log(error);
                    });
            },
        },
        created(){
            console.info("create method");
            // 进入页面判断有是否有存储值
            if(!this.paginationShow){
                var storeVal = getSessionStore("refundRebateManagerStoreForm");
                var otherVal = getSessionStore("refundRebateManagerOtherVal");
                if(storeVal && otherVal){
                    this.searchForm = storeVal;
                    this.$set(this.pager,"currentPage",otherVal.currentPage);
                    this.storeId = otherVal.clueId;
                    this.scrollTop = otherVal.scrollTop;
                }
            };
            // 取页数存储
            var localVal=localStorage.getItem('allChangePageSize')?parseInt(localStorage.getItem('allChangePageSize')):'';
            if(localVal){this.pager.pageSize = localVal;}

            this.searchTable();
            this.getUploadParam();
            this.getProjectList();
        },
        mounted(){
           console.info("mounted method");
           document.getElementById('clueManage').style.display = 'block';
        }
    })
    
</script>
</html>